package com.allwees.bs.module.pms.service.impl;

import com.allwees.bs.module.base.service.impl.BoServiceImpl;
import com.allwees.bs.module.pms.dao.SkuDao;
import com.allwees.bs.module.pms.entity.Sku;
import com.allwees.bs.module.pms.req.query.SkuQueryReq;
import com.allwees.bs.module.pms.service.SkuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.List;

/**
 *
 *
 * @author yangylsky
 * @since 2019-08-21
 *
 */
@Slf4j
@Service
public class SkuServiceImpl extends BoServiceImpl<SkuDao, Sku> implements SkuService {
	@Override
	public List<Sku> getByProductUuid(String productUuid) {
		Assert.notNull(productUuid, "product uuid is not be blank");
		SkuQueryReq skuQueryReq = new SkuQueryReq();
		skuQueryReq.setProductUuids(new String[] {productUuid});
		return findList(skuQueryReq);
	}

	@Override
	public List<Sku> queryImgs() {
		return baseMapper.queryImgs();
	}
}
